package com.deryun.tyl.bean.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import com.deryun.tyl.bean.Industry;

public interface IndustryMapper {
	
	@Select({
		"SELECT * FROM industry"
	})
	List<Industry> getAllIndustry();
	
	@Insert({
		"INSERT INTO industry (title,context,publishDate) VALUES ("
		+ "#{title,jdbcType=VARCHAR},"
		+ "#{context,jdbcType=VARCHAR},"
		+ "#{publishDate,jdbcType=VARCHAR})"
	})
	int addIndustry(Industry industry);
	
	@Delete({
		"DELETE FROM industry WHERE id = #{0,jdbcType=INTEGER}"
	})
	int deleteIndustry(int id);
}
